import { FormSchema } from '/@/components/Table';
import { BasicColumn } from '/@/components/Table';
import { getStamGetAllStamp } from '/@/api/flowManage/flowManage';

export const columns: BasicColumn[] = [
  {
    title: '日期',
    dataIndex: 'createDate',
    width: 100,
    ellipsis: true,
    resizable: true,
  },
  {
    title: '用户名',
    dataIndex: 'realName',
    width: 100,
    ellipsis: true,
    resizable: true,
  },
  {
    title: 'IP',
    dataIndex: 'ip',
    width: 100,
    ellipsis: true,
    resizable: true,
  },
  {
    title: '印章',
    dataIndex: 'title',
    width: 100,
    ellipsis: true,
    resizable: true,
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'userName',
    label: '用户名',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'stampId',
    label: '印章名称',
    component: 'ApiSelect',
    colProps: { span: 6 },
    componentProps: {
      api: getStamGetAllStamp,
      showSearch: true,
      optionFilterProp: 'title',
      labelField: 'title',
      valueField: 'id',
    },
  },
  // {
  //   field: 'beginDate',
  //   label: '开始时间',
  //   component: 'DatePicker',
  //   colProps: { span: 6 },
  //   componentProps: {
  //     format: 'YYYY-MM-DD',
  //     valueFormat: 'YYYY-MM-DD',
  //     style: 'width:100%',
  //   },
  // },
  // {
  //   field: 'endDate',
  //   label: '结束时间',
  //   component: 'DatePicker',
  //   colProps: { span: 6 },
  //   componentProps: {
  //     format: 'YYYY-MM-DD',
  //     valueFormat: 'YYYY-MM-DD',
  //     style: 'width:100%',
  //   },
  // },
  {
    field: 'dates',
    label: '日期',
    component: 'RangePicker',
    componentProps: {
      valueFormat: 'YYYY-MM-DD',
      format: 'YYYY-MM-DD',
      placeholder: ['开始时间', '结束时间'],
      showTime: false,
      style: 'width:100%',
      getPopupContainer: () => document.body,
    },
    colProps: {
      span: 8,
    },
  },
];
